<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <base href="${pageContext.request.scheme}://${pageContext.request.serverName}:${pageContext.request.serverPort}${pageContext.request.contextPath}/"/>
    <link rel="icon" href="static/images/favicon.ico">
    <link rel="stylesheet" href="static/lib/layui-v2.5.5/css/layui.css" media="all">
    <link rel="stylesheet" href="static/css/layuimini.css" media="all">
    <link rel="stylesheet" href="static/css/themes/default.css" media="all">
    <link rel="stylesheet" href="static/lib/font-awesome-4.7.0/css/font-awesome.min.css" media="all">
</head>
<body>
<%--添加--%>
<div id="addpolicies" >
    <form class="layui-form layui-form-pane" lay-filter="example" action="">
        <div id="d1">
        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 50px;">
            <legend>车辆基本信息</legend>
        </fieldset>
        <div class="layui-form-item" style="margin-left: 4px">

            <label class="layui-form-label">号牌号码</label>
                <div class="layui-input-inline" style="width: 90px">
                <input name="licenseid" class="layui-input" type="text" autocomplete="off" lay-verify="required" style="width: 90px">
            </div>

            <label class="layui-form-label">车主</label>
                <div class="layui-input-inline" style="width: 90px">
                <input name="recognizeeid" class="layui-input" type="text" autocomplete="off" style="width: 90px">
            </div>

                <label class="layui-form-label">已行驶公里</label>
                <div class="layui-input-inline" style="width: 140px">
            <select name="mileage" >
                <option value="1000">1000公里以下</option>
                <option value="2000">2000公里以下</option>
                <option value="3000">3000公里以下</option>
            </select>
            </div>
            <%--<label class="layui-form-label">机动车类型</label>
                <div class="layui-input-inline" style="width: 90px">
                <input name="nature" class="layui-input" type="text" autocomplete="off" style="width: 90px">
            </div>--%>

            <label class="layui-form-label">颜色</label>
                <div class="layui-input-inline" style="width: 90px">
                <input name="carcolor" class="layui-input" type="text" autocomplete="off" style="width: 90px">
            </div>
        </div>

        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 50px;">
            <legend>保险生效日期</legend>
        </fieldset>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;客户期望的交强险保单生效的日期:
        <div class="layui-input-inline">
            <div class="layui-input-inline">
                <input name="insurancebegintime" class="layui-input" id="date2" type="text" placeholder="yyyy-MM-dd" autocomplete="off" lay-verify="date">
            </div>
        </div>
        0时至
        <div class="layui-input-inline">
            <div class="layui-input-inline">
                <input name="insuranceendtime" class="layui-input" id="date3" type="text" placeholder="yyyy-MM-dd" autocomplete="off" lay-verify="date">
            </div>
        </div>
        24时止
        <br/>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;客户期望的商业险保单生效的日期:
        <div class="layui-input-inline">
            <div class="layui-input-inline">
                <input name="insuranceBeginTime2" class="layui-input" id="date4" type="text" placeholder="yyyy-MM-dd" autocomplete="off" lay-verify="date">
            </div>
        </div>
        0时至
        <div class="layui-input-inline">
            <div class="layui-input-inline">
                <input name="insuranceEndTime2" class="layui-input" id="date5" type="text" placeholder="yyyy-MM-dd" autocomplete="off" lay-verify="date">
            </div>
        </div>
        24时止

        <%--<div class="layui-form-item" style="text-align: center">

            <button class="layui-btn layui-btn-warm" id="a" >下一步</button>
        </div>--%>
        </div>


        <div id="d2">
            <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
                <legend>交强险信息</legend>
            </fieldset>
            <div class="layui-form">
                <table class="layui-table">
                    <colgroup>
                        <col width="150">
                        <col width="150">
                        <col width="150">
                        <col>
                    </colgroup>
                    <thead>
                    <tr>
                        <th></th>
                        <th>是否投保</th>
                        <th>保险费(元)</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr>
                        <td>交强险</td>
                        <td>
                            <div class="layui-form-item"><div class="layui-input-block">
                                <input name="sex1" type="checkbox"  value="交强险">
                            </div></div>
                        </td>
                        <td>950</td>
                    </tr>
                    </tbody>
                </table>
            </div>


            <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
                <legend>商业险信息</legend>
            </fieldset>
            <div class="layui-form">
                <table class="layui-table">
                    <colgroup>
                        <col width="150">
                        <col width="150">
                        <col width="150">
                        <col width="150">
                    </colgroup>
                    <thead>
                    <tr>
                        <th>基本险</th>
                        <th>投保金额/责任限额</th>
                        <th>是否投保</th>
                        <th>保险费(元)</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr>
                        <td>机动车损失险</td>
                        <td>39900</td>
                        <td> <div class="layui-form-item"><div class="layui-input-block">
                            <input name="sex2" type="checkbox"  value="39900">
                        </div></div></td>
                        <td>701.1</td>
                    </tr>
                    <tr>
                        <td>第三者责任保险</td>
                        <td>50万</td>
                        <td> <div class="layui-form-item"><div class="layui-input-block">
                            <input name="sex3" type="checkbox"  value="1014.12">
                        </div></div></td>
                        <td>1014.12</td>
                    </tr>
                    <tr>
                        <td>车上人员责任险(司机)</td>
                        <td>5万</td>
                        <td>
                            <div class="layui-form-item"><div class="layui-input-block">
                                <input name="sex4" type="checkbox"  value="54.46">
                            </div></div></td>
                        <td>54.46</td>
                    </tr>
                    <tr>
                        <td>车上人员责任险(乘客)</td>
                        <td>1万</td>
                        <td>
                            <div class="layui-form-item"><div class="layui-input-block">
                                <input name="sex5" type="checkbox"  value="54.46">
                            </div></div></td>
                        <td>143.21</td>
                    </tr>
                    <tr>
                        <td>机动车盗抢险</td>
                        <td>16199.4</td>
                        <td> <div class="layui-form-item"><div class="layui-input-block">
                            <input name="sex6" type="checkbox"  value="54.46">
                        </div></div></td>
                        <td>141.73</td>
                    </tr>
                    </tbody>
                </table>
                <table class="layui-table">
                    <colgroup>
                        <col width="150">
                        <col width="150">
                        <col width="150">
                        <col width="150">
                    </colgroup>
                    <thead>
                    <tr>
                        <th>附加险</th>
                        <th>投保金额/责任限额</th>
                        <th>是否投保</th>
                        <th>保险费(元)</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr>
                        <td>玻璃单独破碎险</td>
                        <td>国产玻璃</td>
                        <td> <div class="layui-form-item"><div class="layui-input-block">
                            <input name="sex7" type="checkbox"  value="701.1">
                        </div></div></td>
                        <td>701.1</td>
                    </tr>
                    <tr>
                        <td>车身划痕损失险</td>
                        <td>50万</td>
                        <td> <div class="layui-form-item"><div class="layui-input-block">
                            <input name="sex8" type="checkbox"  value="1014.12">
                        </div></div></td>
                        <td>1014.12</td>
                    </tr>
                    <tr>
                        <td>自然损失险</td>
                        <td>5万</td>
                        <td> <div class="layui-form-item"><div class="layui-input-block">
                            <input name="sex9" type="checkbox"  value="54.46">
                        </div></div></td>
                        <td>54.46</td>
                    </tr>
                    <tr>
                        <td>车上人员责任险(乘客)</td>
                        <td>1万</td>
                        <td> <div class="layui-form-item"><div class="layui-input-block">
                            <input id="sex" name="sex10" type="checkbox"  value="143.21">
                        </div></div></td>
                        <td><div id="a1">143.21</div></td>
                    </tr>
                    <tr>
                        <td>机动车盗抢险</td>
                        <td>16199.4</td>
                        <td> <div class="layui-form-item"><div class="layui-input-block">
                            <input name="sex11" type="checkbox"  value="141.73">
                        </div></div></td>
                        <td>141.73</td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" type="submit" id="demo1" lay-filter="demo1" lay-submit="">立即提交</button>
            </div>
        </div>
    </form>
</div>
<%--添加--%>

<script src="static/lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
<script src="static/lib/jquery-3.4.1/jquery-3.4.1.min.js"></script>
<script src="static/js/lay-config.js" charset="utf-8"></script>
<script>

    layui.use(['form', 'layedit', 'laydate','layer'], function() {
        var form = layui.form
            , layer = layui.layer
            , layedit = layui.layedit
            , laydate = layui.laydate
            , $ = layui.jquery;


        laydate.render({
            elem: '#date2'
        });
        laydate.render({
            elem: '#date3'
        });
        laydate.render({
            elem: '#date4'
        });
        laydate.render({
            elem: '#date5'
        });

        //表单取值
        form.on('submit(demo1)', function (obj) {
            var aaa = obj.field;
            console.log(aaa.sex1);
            console.log("sssss");

            $.post("/warrantyInfo/addWarrantyInfo",obj.field,function (res) {
                console.log(res);
                /*if(res > 0){
                    alert("增加成功");

                }else if(res<= 0){
                    alert("增加失败");
                }*/
                /*layer.msg(data.msg, {icon:1,time:1000}, function(){
                    var index = parent.layer.getFrameIndex(window.name);
                    parent.location.reload(); //刷新父页面
                    parent.layer.close(index);
                });*/
                 parent.location.reload();
                /*parent.aa.reload();*/
            })

            return false;
       })



    });
</script>
</body>
</html>
